package com.bw.liuyushan.mvp_lib.View;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.bw.liuyushan.mvp_lib.Presenter.IPresenter;

/**
 * ZhuanGao4_MVPTest1
 * file name is : BaseActivity
 * created by Ender on 2021/8/11 14:14.
 * author : Liuyushan
 * Describe:Fragment抽象类 继承AppCompatActivity 实现IActivity和IView
 */
public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivity implements IActivity {
    protected P ip;//受子类保护

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(bindLayout());
        initView();
        initDate();
    }

    @Override//销毁
    protected void onDestroy() {
        super.onDestroy();
        if (ip!=null){
            ip.Destory();
            ip=null;
        }
    }
}
